home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MACD 5
/
MACD 5.bin
/
workbench
/
monitory
/
amyload
/
scrollwindow.c
< prev
next >
Wrap
C/C++ Source or Header
|
1987-11-15
|
2KB
|
65 lines
#include <intuition/intuition.h>
#include <devices/load.h>
#include "execdef.h"
#include "intuidef.h"
#include "windowinfo.h"
#include "loadrecord.h"
#include "ScrollWindow.proto"
#include <exec/proto.h>
#include <graphics/proto.h>
#include "NewScale.proto"
#include "FindMaxDataPoint.proto"
#include "DrawScaleReferenceLines.proto"
#include "RedrawWindow.proto"
void
ScrollWindow(window)
Window *window;
{
WindowInfo *window_info;
short scroll_distance;
Bool new_scale;
LoadRecord *record;
window_info = WINDOWINFO(window);
new_scale = FALSE;
scroll_distance = (window_info->width + 1) >> 1;
for (record = (LoadRecord *)window_info->loadrecords.mlh_Head;
record->node.mln_Succ; record = (LoadRecord *)record->node.mln_Succ)
{
/* Scroll the data. */
CopyMemQuick(record->start_data + scroll_distance,
record->start_data,
(window_info->width - scroll_distance) * sizeof(LoadDataValue));
record->next_data -= scroll_distance;
record->max_data -= scroll_distance;
if (record->max_data < record->start_data)
FindMaxDataPoint(record);
if (record->scale)
new_scale = NewScale(window_info, record, *record->max_data) || new_scale;
}
/* Scroll the window. */
if (new_scale)
RedrawWindow(window);
else
{
ScrollRaster(window->RPort,
(short)((window_info->width + 1) >> 1),
(short)0,
window_info->leftedge,
window_info->topedge,
window_info->rightedge,
window_info->bottomedge);
for (record = (LoadRecord *)window_info->loadrecords.mlh_Head;
record->node.mln_Succ; record = (LoadRecord *)record->node.mln_Succ)
if (record->scale)
DrawScaleReferenceLines(window, record, (short)(window_info->width - scroll_distance));
}
}